/*LICENSE_BEGIN
 * ******************************************************************
 * Copyright 2006 by the Dainamite Robocup-Team at the
 * DAI-Labor, TU-Berlin (www.dai-labor.de)
 * 
 * Members of Dainamite are:
 * Holger Endert
 * Robert Wetzker
 * Thomas Karbe
 * Axel Heßler
 * Philippe Bütter
 * Felix Brossmann
 * 
 * Licensed under the GNU GPL (General Public License) Free Software 
 * License, Version 2. You may use this file only in compliance with 
 * the License. You may obtain a copy of the License at:
 * 
 * http://www.fsf.org/licensing/licenses/gpl.txt
 * ******************************************************************
LICENSE_END*/
package robocup.component.infotypes;

import robocup.component.ControllerNumbers.REFEREE_MESSAGE;

/**
 * This info represents the announcement of an event recognized by the
 * referee (e.g. foul, goal, etc.).
 * 
 */
public class RefereeInfo extends AuralInfo {

	/**
	 * The referee message (event), which is received.
	 */
	private REFEREE_MESSAGE infoType = REFEREE_MESSAGE.UNKNOWN;

	/**
	 * A referee-message (such as foul or offside)
	 * 
	 * @param iCycle -
	 *            the time, when it was received
	 * @param type -
	 *            the type of the message
	 */
	public RefereeInfo(int iCycle, REFEREE_MESSAGE type) {
		super(iCycle);
		this.infoType = type;
	}

	/**
	 * Returns the infoType transmitted through this info message
	 */
	public REFEREE_MESSAGE getRefereeMessageType() {
		return this.infoType;
	}


	/**
	 * @return Returns a debug-string for that info-object.
	 */
	@Override
	public String toString() {
		String s = "REFEREE_MESSAGE_";
		s += this.infoType.toString();

		return s;
	}

	/**
	 * Sets a new referee-message to that info-object.
	 * @param infoType
	 */
	public void setRefereeMessageType(REFEREE_MESSAGE infoType) {
		this.infoType = infoType;
	}
}
